package com.changpay.zywy.mvp.presenter

import com.changpay.zywy.base.BasePresenter
import com.changpay.zywy.ext.ss
import com.changpay.zywy.mvp.contract.HomeContract
import com.changpay.zywy.mvp.model.HomeModel


/**
 * Created by chenxz on 2018/5/27.
 */
class HomePresenter : BasePresenter<HomeContract.Model, HomeContract.View>(), HomeContract.Presenter {
    override fun getUnreadInfo(token: String) {
        mModel?.getUnreadInfo(token)?.ss(mModel, mView) {
            mView?.showUnreadInfo(it.result)
        }
    }

    override fun getUserInfo(token: String) {
        mModel?.getUserInfo(token)?.ss(mModel, mView) {
            mView?.showHello(it.result)
        }
    }

    override fun createModel(): HomeContract.Model? = HomeModel()
    override fun getInCome(token: String, version: String) {
        mModel?.getInCome(token, version)?.ss(mModel, mView) {
            mView?.showInCome(it.result)
        }
    }


    override fun getBanner() {
        mModel?.getBanner()?.ss(mModel, mView) {
            mView?.showBanner(it.result)
        }
    }


    override fun getSystemMsgList() {
        mModel?.getSystemMsgList()?.ss(mModel, mView) {
            mView?.showGongGao(it.result)
        }
    }


}